package com.chengjue.utils;

import com.chengjue.model.RequireModel;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.util.ArrayList;
import java.util.List;


public class MoviePrase {

    public static  List<RequireModel> getData(String html) throws Exception {
        // 获取的数据，存放在集合中
        List<RequireModel> list = new ArrayList<>();
        // 采用Jsoup解析
        Document doc = Jsoup.parse(html);
        // 获取html标签中的内容
        Elements elements = doc.getElementsByClass("comment-text");
        for (Element ele : elements) {
            RequireModel item = new RequireModel();
            item.setDescription(ele.html());
            list.add(item);
        }
        return list;
    }

}
